@import './variables.scss';
@import './mixin.scss';
@import './transition.scss';
@import './element-ui.scss';
@import './sidebar.scss';

body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
}

html {
  box-sizing: border-box;
  background-color: lighten($menuBg, 69%);
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

div:focus{
  outline: none;
}

a:focus,
a:active {
  outline: none;
}

a,
a:focus,
a:hover {
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.clearfix {
  &:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: " ";
    clear: both;
    height: 0;
  }
}

//main-container全局样式
.app-main{
  min-height: 100%
}

.app-container {
  padding: 20px;
}

.fr {
  float: right;
}

.fl {
  float: left;
}

.pr-5 {
  padding-right: 5px;
}

.pl-5 {
  padding-left: 5px;
}

.mr-5{
  margin-right: 5px;
}

.mr-15{
  margin-right: 15px;
}

// 处理表格样式
.table{
  border-collapse: collapse;
  width: 100%;
  margin: 0px;
  background-color: #FFF;
  color: #666;
  &.table-line,
  &.table-row,
  th,td{
    border: 1px solid #E6E6E6;
  }

  tr{
    transition: all .3s;
    th{
      text-align: left;
      font-weight: 400;
    }
    th,td{
      position: relative;
      padding: 9px 15px;
      min-height: 20px;
      line-height: 20px;
      font-size: 14px;
    }
  }
  &.table-line {
    th,td{
      border-width: 0;
      border-bottom-width: 1px;
    }
  }
  &.table-row {
    th,td{
      border-width: 0;
      border-right-width: 1px;
    }
  }
  &.table-nob {
    th,td{
      border: none;
    }
  }
  // hover
  thead tr,
  tr th,
  &.table-striped tr:nth-child(even),
  &.table-hover tr:hover,
  &.table-hover tbody tr:hover{
    background-color: #F2F2F2;
  }

  img{
    max-width: 150px;
    max-height: 150px;
  }

  // 表格大小
  &.table-lg{
    th,td{
      padding: 15px 30px;
    }
  }
  &.table-sm{
    th,td{
      padding: 5px 10px;
      font-size: 12px;
    }
  }
}

// 处理表格分页样式
.border-pagination{
  padding: 10px 10px 8px;
  color: #48576a;
  &.pagination-right{
    text-align: right;
  }
  .btn-next,
  .btn-prev,
  .el-pager li{
    border: 1px solid #d1dbe5;
    // background-color: 50% no-repeat #fff;
  }
  .btn-prev{
    border-radius: 3px 0 0 3px;
    border-right-width: 0;
  }
  .btn-next{
    border-radius: 0 3px 3px 0;
  }
  .el-pager{
    li{
      border-right-width: 0;
      &.active{
        border-color: #20a0ff;
        background-color: #20a0ff;
        color: #fff;
        cursor: default;
      }
    }
  }
}

// 处理弹窗样式
.el-dialog__wrapper{
  .el-dialog__header,
  .el-dialog__body,
  .el-dialog__footer{
    padding: 10px;
  }
  .el-dialog__footer{
    padding-bottom: 15px;
  }
  .el-dialog__header{
    .el-dialog__title{
      font-size: 14px;
      font-weight: bold;
    }
    .el-dialog__headerbtn{
      top: 10px;
      right: 15px;
    }
  }

  // 处理深色的弹框样式
  &.dialog-dark-skin{
    .el-dialog__header{
      background-color: $menuBg;
      .el-icon,
      .el-dialog__title{
        color: lighten($menuBg, 72%);
        font-weight: bold;
      }
    }

    .el-dialog__body{
      .el-scrollbar{
        .el-scrollbar__view{
          padding: 5px;
        }
      }
    }

    .el-dialog__footer{
      border-top: 1px solid lighten($menuBg, 66%);
      background-color: lighten($menuBg, 70%);
      padding-bottom: 10px;
    }
  }
}

// 调整 Card 组件 header 样式
.el-card {
  .el-card__header{
    padding: 0px 15px;
    line-height: 40px;
  }
}

// 调整tree整体样式
$treeNodeHeight: 36px;

.el-tree{
  .el-tree-node__content{
    height: $treeNodeHeight;
    .custom-tree-node{
      flex: 1;
      display: flex;
      justify-content: space-between;
      font-size: 14px;
      padding-right: 8px;

      .svg-icon{
        width: 1.5em;
        line-height: $treeNodeHeight;
        &:hover{
          color: red;
        }
      }
    }
  }
  &.el-tree--highlight-current{
    .el-tree-node.is-current{
      >.el-tree-node__content{
        border-left: $hoverBorderHeight solid $menuHover;
      }
    }
  }
}

// 调整 form-inline 样式
.form-inline{
  .el-input{
    width: auto;
  }
}


$iconMargin: $hideSidebarWidth/2 - 7px;

// 调整左侧收缩菜单
#app{
  .hideSidebar{
    .sidebar-container{
      .menu-wrapper{
        > a{
          .el-tooltip{
            padding: 0 !important;
            .svg-icon{
              margin: 0;
              margin: 0 $iconMargin ;
            }
          }
        }
      }
    }
  }
}

